//////////////////////////////////////////////////////////////////////////
// FileName:topSystems.ascx.cs
// CreateBy:Mark
// CreateDate:2009-4-20
// Description:
//		Get The Systems From DataBase.For the main.aspx
//
// Modify Log:		
//	
// Copyright:ASL-MIS
/////////////////////////////////////////////////////////////////////////


using System;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using BLL = Auto.Data.Systems.BLL;
using Model = Auto.Data.Systems.Model;
using Auto.Web.Common;

namespace BaseSystem
{
    public partial class TopModule : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if ( SessionBox.MenuStyle == "PanelBar")
                {
                    getModule();
                }
            }
        }
        private void getModule()
        {
            //Menu m = new Menu();
            //DataTable dtm = m.GetModule();
            BLL.Systems systems = new BLL.Systems();
            DataTable dtSystem = systems.GetSystems(); //new BLL.Systems().GetSystems();
            HtmlGenericControl tr = new HtmlGenericControl("tr");
            HtmlGenericControl td = new HtmlGenericControl("td");
            for (int i = 0; i < dtSystem.Rows.Count; i++)
            {

                HtmlAnchor a = new HtmlAnchor();
                a.HRef = "~/MenuTree.aspx?SysID=" + dtSystem.Rows[i][Model.Systems.FIELD_SysID].ToString();
                a.InnerHtml = "<span>" + dtSystem.Rows[i][Model.Systems.FIELD_SysName].ToString() + "</span>";
                a.Target = "MenuFrame";
                a.Style.Add("color", "BlanchedAlmond");
                a.Style.Add("Font-Size", "14px");
                a.Style.Add("margin","20px");
         
                td.Controls.Add(a);

            }
            td.Style.Add("padding-bottom","10px");

            tr0.Controls.Add(td);
        }
    }
}